home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-03-01 | 1.3 KB | 31 lines | [TEXT/KAHL] |
- // SortingUtils
-
- /**** Sprite sorting routines. ****/
-
- /*But doesn't SAT sort automatically, unless you turn sorting off? Yes, it does, but there are*/
- /*times when you know more than SAT concerning how to sort. SAT does its best, but it can't*/
- /*know that you are moving around one sprite (as in the Bricks demo) and need to sort that*/
- /*and nothing else; SAT has to check them all.*/
- /**/
- /*Use the SortOne routines if you have one sprite that needs to be perfectly sorted.*/
- /**/
- /*If you want to sort the entire sprite list, use BucketSort. The actual sorting is extremely*/
- /*fast, but does not keep track of what sprites were moved. If you use SATRun2, you may*/
- /*need to set the "dirty" flags to make all sprites redraw.*/
-
- #include <SAT.h>
-
- /*Unlinks a sprite from the sprite list.*/
- pascal void UnlinkSprite(SpritePtr sp);
-
- /*Puts a certain sprite at a sorted position according to layer.*/
- pascal void SortOne(SpritePtr sp);
- pascal void SortOneV(SpritePtr sp);
-
- /*BucketSort is useful if you need to make sure the sprite list gets sorted at*/
- /*once - and it is really fast! It is designed for sorting after the layer field, so if you*/
- /*want it to sort after the vertical position, you need to edit it.*/
- pascal void BucketSort(short minLayer, short maxLayer);
- pascal void BucketSortV(short minLayer, short maxLayer);
-
-